package com.cskaoyan.market.controller.wx;

import com.cskaoyan.market.db.domain.MarketCollect;
import com.cskaoyan.market.service.WxMyCollectService;
import com.cskaoyan.market.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@RestController
@RequestMapping("wx/collect")
public class WxMyCollectController {
    @Autowired
    WxMyCollectService wxMyCollectService;


    @GetMapping("list")
    public Object list() {
        Map<String, Object> data = wxMyCollectService.listCollects();
        return ResponseUtil.ok(data);
    }

    @PostMapping("addordelete")
    public Object addOrDelete(@RequestBody MarketCollect marketCollect) {
        wxMyCollectService.addOrDelete(marketCollect);
        return ResponseUtil.ok();
    }
}

